﻿// -----------------------------------------------------------------------
// <copyright file="ConsultaPrivada.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

using System.ComponentModel.Composition;
using System.Text.RegularExpressions;
using TPTecnicas.MessageProcessor.Business;
using TPTecnicas.MessageProcessor.Common;

namespace TPTecnicas.MessageProcessor.Rules
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    [Export(typeof(IRule))]
    [ExportMetadata("Name", "ConsultaPrivada")]
    public class ConsultaPrivada : Consulta
    {
        [ImportingConstructor]
        public ConsultaPrivada([Import("context")]IUniversityContext context)
            : base(context)
        {

        }

        protected override Match GetMatch(IMessage message)
        {
            var regex = new Regex(@"^\[CONSULTA-PRIVADA\] (?<tema>.*)$");
            return regex.Match(message.Subject);
        }
    }
}
